package it.xiuxian.tradecenter.presenter

import com.lzy.okgo.OkGo
import it.xiuxian.lib.base.BaseBean
import it.xiuxian.lib.base.BasePresenter
import it.xiuxian.lib.base.ILoadBind
import it.xiuxian.lib.http.CallBackOption
import it.xiuxian.lib.http.HttpConfig
import it.xiuxian.lib.utils.EncodeUtils
import it.xiuxian.tradecenter.bean.VideoBean
import it.xiuxian.tradecenter.fragment.NewTradCenterFragment
import org.json.JSONObject

class NewTradCenterFragmentPresenter:BasePresenter<NewTradCenterFragment>() {
    fun getList(){
        OkGo.post<BaseBean<VideoBean>>(HttpConfig.BASE_URL+"/appksvideo/list")
                .execute(object : CallBackOption<BaseBean<VideoBean>>() {}.loadBind(mView as NewTradCenterFragment).execute(
                        object : ILoadBind<BaseBean<VideoBean>> {
                            override fun excute(bean: BaseBean<VideoBean>) {
                                if(bean.code==0){
                                    (mView as NewTradCenterFragment).getList(bean.data)
                                }
                            }
                        }
                ))
    }

}